// 封装用户预约相关接口
import request from '@/utils/request'

// 获取用户预约记录
export const getOrderService = ({ pageSize, page }) => {
  return request({
    url: '/api/order',
    method: 'GET',
    params: {
      pageSize,
      page
    }
  })
}

// 修改预约状态
export const changeOrderService = ({ id, status }) => {
  return request({
    url: `/api/order/change/${id}`,
    method: 'PATCH',
    params: {
      status
    }
  })
}

// 删除预约记录
export const deleteOrderService = (id) => {
  return request({
    url: `/api/order/del/${id}`,
    method: 'Delete'
  })
}

// 搜索预约记录
export const searchOrderService = (data) => {
  return request({
    url: '/api/order/search',
    method: 'GET',
    params: {
      data
    }
  })
}
